import pymysql
import iot_dbpool


def insert_demo(sql):
    try:
        conn = pymysql.connect(host='localhost',
                               user='root',
                               password='Puma@2022emqx!',
                               database='evtest')
        cur = conn.cursor()
        cur.execute(sql)
        conn.commit()
    except:
        conn.rollback()
    finally:
        conn.close()


print(iot_dbpool.select_data("select * from evpayload where id<%s;", ("6")))
